#!/usr/bin/env python
# -*- coding: utf-8 -*-

'''eof
name:目标公司一度关联方自然人比例
code:R1PerRatio
tableName:
columnName:
groups:关联方
dependencies:EG_BBD
type:常用指标
dataSourceType:在线指标
description:
eof'''

import sys

reload(sys)
sys.setdefaultencoding('utf-8')


def float_check(num):
    try:
        float(num)
        return True
    except:
        return False


def R1PerRatio():
    try:
        R1PerRatio = EG_BBD["R1PerRatio"]
        if float_check(R1PerRatio):
            return R1PerRatio
        elif R1PerRatio == '':
            return 0
        else:
            return u'缺失值'
    except:
        return u'缺失值'


result = R1PerRatio()

